package players;

import java.util.ArrayList;
import java.util.Random;

import model.*;

public class RandomPlayer implements Player
{
	Random rand;
	
	public RandomPlayer()
	{
		rand = new Random();
	}

	public boolean move(OthelloBoard board, byte color) 
	{
		ArrayList<Position> moves = board.getTransitions(color);
		if (moves.size() == 0)
		{
			return false;
		}
		int k = rand.nextInt(moves.size());
		board.makeTransition(moves.get(k), color);
		return true;
	}

	public double evaluate(OthelloBoard board, byte color) 
	{
		return Math.random(); //all the same
	}
	
	public String toString()
	{
		return "Random";
	}
	
	@Override
	public void setExploration(boolean aan) {
		// TODO Auto-generated method stub
		
	}
}
